# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 6
n 6(None)[translation_dict = soundconfig_dict
]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb765e7ec>}
nname: 225
n 225(None)[]:
	i: 181(), 204(), 223(AE)
	o: 

nname: 223
n 223(None)[]:
	i: 194(f)
	o: 225(AE)

nname: 204
n 204(None)[#, e
PRINT_EXCEPTION(e)
]:
	i: 194(t)
	o: 225()

nname: 194
n 194(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 204(t), 223(f)

nname: 181
n 181(None)[del _[1]
for self.preview_list in choices_list:
]:
	i: 49(AF), 150()
	o: 225()

nname: 150
n 150(None)[]:
	i: 80&131(t), 142()
	o: 181()

nname: 142
n 142(None)[]:
	i: 80&131(f)
	o: 150()

nname: 80&131
n 80&131(val == value and '%s_checked' % val)[for val in choices_list:
]:
	i: 49(for)
	o: 142(f), 150(t)

nname: 49
n 49(None)[value = config.user_config[domain][key]
]:
	i: 0(try)
	o: 80&131(for), 181(AF)

nname: 0
n 0(None)[ParametersSetupItem.__init__(self, *args, **kw)
self.domain = domain
self.key = key
self.choices_list = choices_list
]:
	i: 
	o: 49(try), 194(except)

nname: 225
n 225(None)[]:
	i: 181(), 194()
	o: 

nname: 194
n 194(None)[except AttributeError, e:
	PRINT_EXCEPTION(e)
]:
	i: 0()
	o: 225()

nname: 181
n 181(None)[del _[1]
for self.preview_list in choices_list:
]:
	i: 0(AF), 80&131(t)
	o: 225()

nname: 80&131
n 80&131(None)[for val in choices_list:
if not(val == value and '%s_checked' % val):
	pass
]:
	i: 0(for)
	o: 181()

nname: 0
n 0(None)[ParametersSetupItem.__init__(self, *args, **kw)
self.domain = domain
self.key = key
self.choices_list = choices_list
try:
	value = config.user_config[domain][key]
]:
	i: 
	o: 80&131(for), 181(AF), 194()

self.nodes: {0: <unpyclib.structure.node instance at 0xb76680ac>, 225: <unpyclib.structure.node instance at 0xb7660e6c>, 194: <unpyclib.structure.node instance at 0xb7668aac>, '80&131': <unpyclib.structure.node instance at 0xb76680ec>, 181: <unpyclib.structure.node instance at 0xb7660c6c>}
nname: 0
n 0(None)[from pygui.shared import pygui_globs
from pygui.actions.jobs.player import go_aspect
context = dict(menu=self.menu, selected=self, parent=None)
display = pygui_globs['display']
go_aspect(context, display, val)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7668a2c>}
nname: 129
n 129(None)[return self.preview_list
]:
	i: 0(AL), 128()
	o: 

nname: 128
n 128(None)[]:
	i: 26(AF), 119()
	o: 129()

nname: 119
n 119(None)[it.display_type = '%s_not_checked' % choice
]:
	i: 51&100(t), 111()
	o: 128()

nname: 111
n 111(None)[]:
	i: 51&100(f)
	o: 119()

nname: 51&100
n 51&100(val == it.args[0] and '%s_checked' % choice)[for it, choice in itertools.izip(self.preview_list, self.choices_list):
it.name = self.translation_dict.get(choice)
]:
	i: 26(for)
	o: 111(f), 119(t)

nname: 26
n 26(None)[]:
	i: 0(loop)
	o: 51&100(for), 128(AF)

nname: 0
n 0(None)[val = config.user_config[self.domain][self.key]
]:
	i: 
	o: 26(loop), 129(AL)

nname: 129
n 129(None)[return self.preview_list
]:
	i: 0(AL), 26(AF), 51&100()
	o: 

nname: 51&100
n 51&100(None)[for it, choice in itertools.izip(self.preview_list, self.choices_list):
it.name = self.translation_dict.get(choice)
if not(val == it.args[0] and '%s_checked' % choice):
	pass
it.display_type = '%s_not_checked' % choice
]:
	i: 26(for)
	o: 129()

nname: 26
n 26(None)[]:
	i: 0(loop)
	o: 51&100(for), 129(AF)

nname: 0
n 0(None)[val = config.user_config[self.domain][self.key]
]:
	i: 
	o: 26(loop), 129(AL)

nname: 51&100
n 51&100(None)[for it, choice in itertools.izip(self.preview_list, self.choices_list):
	it.name = self.translation_dict.get(choice)
	if not(val == it.args[0] and '%s_checked' % choice):
		pass
	it.display_type = '%s_not_checked' % choice
return self.preview_list
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[val = config.user_config[self.domain][self.key]
]:
	i: 
	o: 51&100(for)

nname: 0
n 0(None)[val = config.user_config[self.domain][self.key]
for it, choice in itertools.izip(self.preview_list, self.choices_list):
	it.name = self.translation_dict.get(choice)
	if not(val == it.args[0] and '%s_checked' % choice):
		pass
	it.display_type = '%s_not_checked' % choice
return self.preview_list
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7668bec>}
nname: 6
n 6(None)[__doc__ = "Used to set the user's display's aspect ratio:\n        - 16:9 for a widescreen display (e.g. HDTV).\n        - 4:3 for an oldschool TV.\n    "
depth = 2
translation_dict = ui_aspect_ratio_dict
def __init__(self, domain, key, choices_list, *args, **args):
	ParametersSetupItem.__init__(self, *args, **kw)
	self.domain = domain
	self.key = key
	self.choices_list = choices_list
	try:
		value = config.user_config[domain][key]

def execute_action(self, val):
	from pygui.shared import pygui_globs
	from pygui.actions.jobs.player import go_aspect
	context = dict(menu=self.menu, selected=self, parent=None)
	display = pygui_globs['display']
	go_aspect(context, display, val)
	return None

def browse(self):
	val = config.user_config[self.domain][self.key]
	for it, choice in itertools.izip(self.preview_list, self.choices_list):
		it.name = self.translation_dict.get(choice)
		if not(val == it.args[0] and '%s_checked' % choice):
			pass
		it.display_type = '%s_not_checked' % choice
	return self.preview_list

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb765ebec>}
nname: 0
n 0(None)[ParametersSetupItem.__init__(self, *args, **kw)
self.preview_list = [LanguageUserConfigSetupItem(domain='video', key='language', choices_list=config.HMI_VIDEO['languages'], name='Default audio track', type_='setupitem')]
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb765eecc>}
nname: 6
n 6(None)[depth = 3
def __init__(self, *args, **args):
	ParametersSetupItem.__init__(self, *args, **kw)
	self.preview_list = [LanguageUserConfigSetupItem(domain='video', key='language', choices_list=config.HMI_VIDEO['languages'], name='Default audio track', type_='setupitem')]

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb765ebec>}
nname: 0
n 0(None)[from __future__ import absolute_import
from . import ParametersSetupItem
import pygui.config as config
from pygui.facilities.codemapping import soundconfig_dict, ui_aspect_ratio_dict
from pygui.item.parameters import BooleanUserConfigSetupItem, UserConfigSetupItem
from pygui.item.parameters.generalsetup.i18n import LanguageUserConfigSetupItem
import itertools
from ..core import ActionItem, Item
class SoundFormatParametersSetupItem(UserConfigSetupItem):
	translation_dict = soundconfig_dict


class AspectRatioParametersSetupItem(UserConfigSetupItem):
	__doc__ = "Used to set the user's display's aspect ratio:\n        - 16:9 for a widescreen display (e.g. HDTV).\n        - 4:3 for an oldschool TV.\n    "
	depth = 2
	translation_dict = ui_aspect_ratio_dict
	def __init__(self, domain, key, choices_list, *args, **args):
		ParametersSetupItem.__init__(self, *args, **kw)
		self.domain = domain
		self.key = key
		self.choices_list = choices_list
		try:
			value = config.user_config[domain][key]

	def execute_action(self, val):
		from pygui.shared import pygui_globs
		from pygui.actions.jobs.player import go_aspect
		context = dict(menu=self.menu, selected=self, parent=None)
		display = pygui_globs['display']
		go_aspect(context, display, val)
		return None

	def browse(self):
		val = config.user_config[self.domain][self.key]
		for it, choice in itertools.izip(self.preview_list, self.choices_list):
			it.name = self.translation_dict.get(choice)
			if not(val == it.args[0] and '%s_checked' % choice):
				pass
			it.display_type = '%s_not_checked' % choice
		return self.preview_list



class VideoParametersSetupItem(ParametersSetupItem):
	depth = 3
	def __init__(self, *args, **args):
		ParametersSetupItem.__init__(self, *args, **kw)
		self.preview_list = [LanguageUserConfigSetupItem(domain='video', key='language', choices_list=config.HMI_VIDEO['languages'], name='Default audio track', type_='setupitem')]



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76538cc>}
from __future__ import absolute_import
from . import ParametersSetupItem
import pygui.config as config
from pygui.facilities.codemapping import soundconfig_dict, ui_aspect_ratio_dict
from pygui.item.parameters import BooleanUserConfigSetupItem, UserConfigSetupItem
from pygui.item.parameters.generalsetup.i18n import LanguageUserConfigSetupItem
import itertools
from ..core import ActionItem, Item
class SoundFormatParametersSetupItem(UserConfigSetupItem):
	translation_dict = soundconfig_dict


class AspectRatioParametersSetupItem(UserConfigSetupItem):
	__doc__ = "Used to set the user's display's aspect ratio:\n        - 16:9 for a widescreen display (e.g. HDTV).\n        - 4:3 for an oldschool TV.\n    "
	depth = 2
	translation_dict = ui_aspect_ratio_dict
	def __init__(self, domain, key, choices_list, *args, **args):
		ParametersSetupItem.__init__(self, *args, **kw)
		self.domain = domain
		self.key = key
		self.choices_list = choices_list
		try:
			value = config.user_config[domain][key]

	def execute_action(self, val):
		from pygui.shared import pygui_globs
		from pygui.actions.jobs.player import go_aspect
		context = dict(menu=self.menu, selected=self, parent=None)
		display = pygui_globs['display']
		go_aspect(context, display, val)
		return None

	def browse(self):
		val = config.user_config[self.domain][self.key]
		for it, choice in itertools.izip(self.preview_list, self.choices_list):
			it.name = self.translation_dict.get(choice)
			if not(val == it.args[0] and '%s_checked' % choice):
				pass
			it.display_type = '%s_not_checked' % choice
		return self.preview_list



class VideoParametersSetupItem(ParametersSetupItem):
	depth = 3
	def __init__(self, *args, **args):
		ParametersSetupItem.__init__(self, *args, **kw)
		self.preview_list = [LanguageUserConfigSetupItem(domain='video', key='language', choices_list=config.HMI_VIDEO['languages'], name='Default audio track', type_='setupitem')]



